package shenlong.android.motorkeeper.lock.fragment;

import shenlong.android.motorkeeper.lock.MainActivity;
import shenlong.android.motorkeeper.lock.common.Constant;
import shenlong.android.motorkeeper.lock.common.Constant.LockStatus;
import shenlong.android.motorkeeper.R;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;

public class MainFragment extends Fragment{
	private ImageButton btnLock;
	private LockStatus lockStatus = LockStatus.UNLOCK;
	public MainFragment() {
    }	
	public static MainFragment newInstance(int sectionNumber) {
		
		MainFragment fragment = new MainFragment();
        Bundle args = new Bundle();
        args.putInt(Constant.ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {    	
        View rootView = inflater.inflate(R.layout.fragment_main, container, false);
        btnLock = (ImageButton)rootView.findViewById(R.id.btnLock);
        btnLock.setOnClickListener(new View.OnClickListener() {
            @Override
			public void onClick(View v) {
            	btnLock_Click(v);
            }
        });
        return rootView;
    }
    public void btnLock_Click(View v)
    {
    	
    }
    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        ((MainActivity) activity).onSectionAttached(
                getArguments().getInt(Constant.ARG_SECTION_NUMBER));
    }
	
}
